home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 090 / popmse.arc / POPMOUSE.DOC < prev    next >
Encoding:
Text File  |  1987-08-22  |  5.7 KB  |  143 lines

  1.               
  2.        Inspired by POPMENU from BWTOOLS by Dave Evers and using mouse 
  3.        and screen handling routines from ADVBAS by Thomas Hanlin III, 
  4.        POPMOUSE is hereby placed in the Public Domain.
  5.  
  6.        This subroutine was tested with ADVBAS v3.4, 06/25/87
  7.                                        QuickBasic v3.0, 04/07/87   
  8.  
  9.        Ray Schwarz 76012,133
  10.  
  11.        Version 1.0 08/22/87
  12.  
  13.  
  14.       POPMOUSE
  15.  
  16.       Purpose:  Used to select options from several popup menu windows
  17.       using the cursor keys or the mouse to move a 'select bar'.
  18.       Selection is made by the Enter key or the left mouse button.  
  19.  
  20.       CALL POPMOUSE(PROMPTS$(SET%),L%(SET%),SET%,ITEMS$(),FRAME%,FORE%,
  21.                     BACK%,HFORE%,HBACK%,QUADRANT$,SHADOW%,CHOICE%)
  22.  
  23.       Passed:
  24.                    
  25.        PROMPTS$  - A string array holding the Menu Headings which you
  26.                    wish to place in the header position (top row) of the
  27.                    window.  The length of this string will determine the
  28.                    width of the menu window unless a choice description
  29.                    in array ITEMS$() below is longer.  
  30.  
  31.         L%(SET%) - An integer array with the number of choices in the
  32.                    menu set.
  33.                    
  34.             SET% - Used to select which menu to display
  35.                    
  36.        ITEMS$(,) - A two-dimensional array (i.e.  ITEMS$(1,1) holding the
  37.                    actual menu item strings.  The first dimension holds
  38.                    the menu number, and the second holds the item number
  39.                    within a menu.  Thus, ITEMS$(1,1) would be the first
  40.                    item in Menu #1; and ITEMS$(5,10) would be the 10th
  41.                    item in Menu #5.  
  42.  
  43.                        NOTE: In order for the highlighted 'select bar'
  44.                              to be of constant length for each menu, the
  45.                              length of the menu item descriptions for
  46.                              each set must be equal.  This can easily be
  47.                              done by adding spaces to the end of each
  48.                              description as necessary.  
  49.  
  50.           FRAME% - An integer defining the type of frame style for the
  51.                    window as follows: 
  52.  
  53.                       0 - No frame. Just a border of spaces
  54.                           of the background color.
  55.  
  56.                       1 - A single line frame.
  57.  
  58.                       2 - A double line frame.
  59.  
  60.                       3 - A single horizontal line,
  61.                           double vertical line frame.
  62.  
  63.                       4 - A double horizontal line,
  64.                           single vertical line frame.
  65.  
  66.            FORE% - The foreground color; ranging from 0 (BLACK) to 15
  67.                    (BRIGHT WHITE).  This will be the color of the frame.  
  68.  
  69.            BACK% - The background color (the color of the window).  Can
  70.                    range from 0 (BLACK) to 7 (WHITE).  
  71.  
  72.           HFORE% - The foreground color of the Header.
  73.  
  74.           HBACK% - The background color of the Header.
  75.  
  76.        QUADRANT$ - A string which defines where on the
  77.                    screen the window will be placed; used
  78.                    as follows:
  79.  
  80.                        ---------------------------
  81.                       |             .             |
  82.                       |      1      .      2      |
  83.                       |             .             |
  84.                       |.............0.............|
  85.                       |             .             |
  86.                       |             .             |
  87.                       |      4      .      3      |
  88.                       |             .             |
  89.                        ---------------------------
  90.  
  91.  
  92.                       "0" - In the exact center of the
  93.                             screen; centered according
  94.                             to menu size.
  95.  
  96.                       "1" - Upper Left Quadrant.
  97.  
  98.                       "2" - Upper Right Quadrant.
  99.  
  100.                       "3" - Lower Right Quadrant.
  101.  
  102.                       "4" - Lower Left Quadrant.
  103.  
  104.                   "rr:cc" - Specifies exact coordinates
  105.                             of upper left corner of window
  106.                             to be row rr and column cc
  107.                             (two digits each).
  108.  
  109.  
  110.  
  111.          SHADOW% - A switch to determine if menu window will have a
  112.                    black shadow underneath.  1 will produce shadow, 0
  113.                    will not.  
  114.  
  115.     Returns:
  116.  
  117.          CHOICE% - An integer with the number of the item selected.
  118.                    This can be used in an ON SELECT% GOSUB ....
  119.                    statement to route program flow to the desired
  120.                    section.  If [ESC] is pressed, SELECT% will be 0.   
  121.  
  122.                    
  123.     Other files:
  124.  
  125.         POPMOUSE.BAS - QuickBasic program to demo POPMOUSE
  126.         NEWLIB.BLD - Buildfile to add POPMOUSE to the files contained in
  127.                      ADVBAS.EXE user library.
  128.  
  129.         To add:
  130.                 1. Compile POPMOUSE to .obj (using BRUN.LIB)                 |
  131.                 2. Extract the .OBJ files from OBJECT.ARC included with
  132.                    ADVBAS to the same disk/directory.
  133.                 3. Enter BUILDLIB < NEWLIB.BLD
  134.                 4. The resulting file "NEWLIB.EXE" will have all of the
  135.                    ADVBAS routines as well as POPMOUSE.
  136.                 
  137.        A similar process can be followed to add POPMOUSE to the
  138.        ADVBAS.LIB using the /o (using BCOM.LIB) option and the MASM          | 
  139.        LIB program or alternately the POPMOUSE.OBJ (again /o) can be
  140.        added during the LINK process:
  141.  
  142.                 LINK prog+POPMOUSE,.....        
  143.